package com.kaili.common.response;


import com.kaili.common.exception.IResponseStatus;

/**
 * 返回结果集
 * @Copyright: Copyright (c) 2017
 * @Company: 杭州凯立通信有限公司
 * @author zhengs
 * @version 1.0.0 2017年7月18日 下午1:29:41
 */
public class ResponseData{

	/**
	 * 返回状态码
	 */
	private int status;

	/**
	 * 返回消息
	 */
	private String message;

	/**
	 * 返回数据
	 */
	private Object data;


	public ResponseData(int status, String message){
		this.status = status;
		this.message = message;
	}

	public ResponseData(){

	}

	public ResponseData(RestStatus status){
		this.status = status.value();
		this.message = status.reasonPhrase();
	}

	public ResponseData(IResponseStatus status){
		this.status = status.getCode();
		this.message = status.getMsg();
	}

	public ResponseData(Object data, CommonStatus status){
		this.data = data;
		this.status = status.value();
		this.message = status.getReasonPhrase();
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
}